package com.zhuangjie.coupon.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zhuangjie.coupon.dto.ShopCouponBatchDTO;
import com.zhuangjie.coupon.entity.CouponBatch;
import org.redisson.api.RLock;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author zhuangjie
 * @since 2024-02-28
 */
public interface CouponBatchService extends IService<CouponBatch> {
    void sendCouponToUser(CouponBatch couponBatch, Integer number, Long currentUserId);

    RLock applyCoupon(Long couponBatchId, Integer applyCount);

    void putShopCouponBatch(ShopCouponBatchDTO shopCouponBatchDTO) throws Exception;

    List<CouponBatch> queryShopCouponBatchList();

    void removeShopCouponBatchById(Long couponBatchId);

    ShopCouponBatchDTO getShopCouponBatchById(Long couponBatchId);

    void receiveShopPublicCoupon(Long batchId);
}
